//$Id:  $
//$Date:  $
//$Author:  $
package com.ajaxit.prisa.struts;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class ValidarUsuarioForm extends ActionForm {
	private static final long serialVersionUID = 1L;
	private String login;
	private String passwd;
	
	public ActionErrors validate( ActionMapping mapping, HttpServletRequest request ) {
		ActionErrors errors = new ActionErrors ( );
		if ( login == null || login.length ( ) < 1 ) {
			errors.add ( "login", new ActionMessage ( "error.missing.loginPasswd" ) );
			System.out.println ( "login" + new ActionMessage ( "error.missing.loginPasswd" ) );
		}
	    if ( passwd == null || passwd.length ( ) < 1 ) {
			errors.add ( "passwd", new ActionMessage ( "error.missing.loginPasswd" ) );
			System.out.println ( "passwd" + new ActionMessage ( "error.missing.loginPasswd" ) );
	    }
		return errors;
	}

	public String getLogin ( ) {
		return login;
	}

	public String getPasswd ( ) {
		return passwd;
	}

	public void reset ( ) {
		
	}

	public void setLogin ( String fecha ) {
		this.login = fecha;
	}

	public void setPasswd ( String local ) {
		this.passwd = local;
	}
}
//$Revision:  $
